package com.example.business_oa.service;

import com.example.comment_oa.dubbo.ChaJiaBanBeiShuDubbo;
import com.example.comment_oa.dubbo.ChaWuXianYiJinDubbo;
import com.example.comment_oa.pojos.FiveGold;
import com.example.comment_oa.pojos.xinzi.JibenWuxianyijin;
import io.seata.spring.annotation.GlobalTransactional;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChaWuXianYiJinService {

    @DubboReference(version = "1.0.0")
    ChaWuXianYiJinDubbo chaWuXianYiJinDubbo;

    @GlobalTransactional(timeoutMills = 300000)
    public List<FiveGold> selectwuxainyijin(){
        List<FiveGold> fiveGolds = chaWuXianYiJinDubbo.selectAll();
        return fiveGolds;
    }
    @GlobalTransactional(timeoutMills = 300000)
    public int tianjaiwuxianyijin(JibenWuxianyijin jibenWuxianyijin){
        return  chaWuXianYiJinDubbo.insertAllWuXianYiJin(jibenWuxianyijin);

    }
}
